<template>
  <div>
    <common-head title="新增联系人"/>
    <div class="wrap">
      <van-address-edit
        :area-list="areaList"
        show-postal
        show-set-default
        :area-columns-placeholder="['请选择', '请选择', '请选择']"
        @save="onSave"
      />
    </div>
  </div>
</template>

<script>
import CommonHead from '../../components/CommonHead.vue'
import { areaList } from '@vant/area-data'
import { Toast } from 'vant'
export default {
  data () {
    return {
      areaList
    }
  },
  methods: {
    onSave (contact) {
      console.log(contact)
      this.$store.commit('contact/add_contact', contact)
      Toast('增加成功')
      this.$router.replace('/contactLists')
    }
  },
  components: { CommonHead }
}
</script>

<style lang="scss" scoped>
.wrap{
  padding-top: 46px;
}
</style>
